home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / RGASM.RAR / ASMCODE.EXE / CHAPT1-5 / REPBIOS.ASM < prev    next >
Encoding:
Assembly Source File  |  1994-08-27  |  1.7 KB  |  37 lines

  1. ;
  2. ;       Program RepBios ( Chapter 4 )
  3. ;
  4. .model  small
  5. .stack
  6. .data
  7. TitMsg  db        'Your computer has ROM BIOS version '
  8. Vers    db        64 dup (' ')
  9. .code
  10. .startup
  11.         mov       DatSeg,ds            ; save DATA segment address
  12.         mov       es,ROM_BIOS          ; ES points to ROM BIOS
  13.         mov       di,0FFF5h            ; ES:DI point to BIOS date
  14.         mov       cx,64                ; 64 character to search
  15.         mov       al,0                 ; AL - character to search
  16. repne   scasb                          ; find first match
  17.         jnz       ExProg               ; NUL not found - exit
  18.         mov       cx,di                ; DI -> character following NUL
  19.         sub       cx,0FFF5h            ; CX now contains data length
  20.         cmp       cx,9                 ; date must look like xx/xx/xx
  21.         jb        ExProg               ; if not 9 characters, exit
  22.         mov       bx,cx                ; BX contains position of NUL
  23.         mov       ds,ROM_BIOS          ; DS points to ROM BIOS
  24.         mov       es,DatSeg            ; ES points DATA segment
  25.         lea       di,Vers              ; ES:DI point to Vers
  26.         mov       si,0FFF5h            ; DS:SI point to BIOS date
  27. rep     movsb                          ; copy BIOS date to Vers
  28.         mov       ds,DatSeg            ; DS points to ROM BIOS
  29.         mov       Vers[bx-1],'$'       ; append EndOf Message
  30.         lea       dx,TitMsg            ; address of message for output
  31.         mov       ah,09h               ; func. 09 - output text string
  32.         int       21h                  ; DOS service call
  33. ExProg:.exit      0
  34. ROM_BIOS          dw         0F000h
  35. Datseg  dw        0
  36.         end
  37.